package com.gopay.bis.pab.expay.operation;

import com.gopay.bis.common.util.BankLogUtils;
import com.gopay.common.constants.bank.BankConstants;
import com.gopay.common.domain.bank.BaseMessage;
import com.gopay.common.domain.bank.ExPayBaseMessage;

/**
 * 
 * @ClassName: PabExPayDataSubmit
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author ShenJun
 * @date 2016年10月14日 下午5:36:40
 */
public class PabExPayDataSubmit {

    private PabHttpsTransport pabHttpsTransport;
    /**
     * 平安提交地址
     */
    private String url ;
    // private String
    // url="https://ebtest.cebbank.com/agreeEpayper/quickPayAccess.do";

    /**
     * 
     * @Description: 提交数据 
     * @param data
     * @return 
     * @author ShenJun
     */
    public Object submitData(String data) {
        //发送方法
        ExPayBaseMessage baseMessage = new ExPayBaseMessage();
        baseMessage.setBank(BankConstants.BANK_LOGO_PAB);
        try {
            byte[] submitData = data.getBytes("UTF-8");
            Object messageData = new Object();
            pabHttpsTransport.setUrl(url);
            messageData = pabHttpsTransport.submit(submitData);
            return messageData;
        } catch (Exception e) {
            BankLogUtils.printExPayExceptionLog(baseMessage, e);
            return null;
        }

    }



    public PabHttpsTransport getPabHttpsTransport() {
		return pabHttpsTransport;
	}



	public void setPabHttpsTransport(PabHttpsTransport pabHttpsTransport) {
		this.pabHttpsTransport = pabHttpsTransport;
	}



	public void setUrl(String url) {
        this.url = url;
    }

}
